// JavaScript Document 公共的

//TEST GET HTML ALL
function TEST_GET_HTML_ALL(){
	var title = $("input[NOTE-TITLE]").val();
	var content = $("textarea[NOTE-CONTENT]").val();
	alert(title+"          \n"+content);
}

//收藏Notes:NotesCollectController
//<a href="javascript:void(0);" option="collect" url="/addCollect" dateUser="${NOTES_OBJ.user_id}" dateID="${NOTES_OBJ.id!}" F-R ABTN>收藏</a>
$("a[option='collect']").click(function(){
	var obj = $(this);
	var url = obj.attr("url");
	var data = {notes_id:obj.attr("dateID"), notes_userid:obj.attr("dateUser")};
	$.ajax({
		type: "POST",
		url: url,
		data: data,
		error: function(err){
			alert("error");
		},
		success: function(result){
			var _obj = $("a[option='collect']");
			if(result.status == 1){
				_obj.html(result.message);
				_obj.attr({url:result.date});
			}else{
				// _obj.html("error");
			}
		}
	});
});